<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template3.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">
    <ui:define name="content">
        <h:outputText value="Funcionários" />  
        <p:growl id="msgs" showDetail="true" />  
        <p:panel id="pnlGrid">
            <p:dataTable id="dataTable" var="f" value="#{FuncionarioBean.lstFuncionarios}"
                         paginator="true" rows="10"  
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                         rowsPerPageTemplate="5,10,15"> 
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Matricula" />  
                    </f:facet>  
                    <h:outputText value="#{f.matricula}" />  
                </p:column>  
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Nome" />  
                    </f:facet>  
                    <h:outputText value="#{f.nome}" />  
                </p:column>  
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Email" />  
                    </f:facet>  
                    <h:outputText value="#{f.email}" />  
                </p:column>  
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Sexo" />  
                    </f:facet>  
                    <h:outputText value="#{f.sexo}" />  
                </p:column>  
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Cpf" />  
                    </f:facet>  
                    <h:outputText value="#{f.cpf}" />  
                </p:column>  
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="RG" />  
                    </f:facet>  
                    <h:outputText value="#{f.rg}" />  
                </p:column>  
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Sexo" />  
                    </f:facet>  
                    <h:outputText value="#{f.sexo}" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Data cadastro" />  
                    </f:facet>  
                    <h:outputText value="#{f.dataCadastro}" />  
                </p:column>  
                <p:column style="width:4%">  
                    <p:commandButton id="editButton" icon="ui-icon-search" title="View">  
                        <!--<f:setPropertyActionListener value="#{car}" target="#{tableBean.selectedCar}" />-->  
                    </p:commandButton>  
                </p:column>  
            </p:dataTable>
        </p:panel>
        <p:dialog widgetVar="dlg" resizable="false" id="pnlEdicao" modal="true" >
            <h:form >
                <p:panelGrid  id="pngCad1" columns="4" style="width: 100%; margin-bottom: 10px" >
                    <h:outputText value="Matricula"></h:outputText>
                    <p:inputText id="txtMatricula" value="" ></p:inputText>
                    <h:outputText value="Nome"></h:outputText>
                    <p:inputText id="txtNome" value="" ></p:inputText>
                    <h:outputText value="Email"></h:outputText>
                    <p:inputText id="txtEmail" value="" ></p:inputText>

                    <h:outputText value="Sexo: " />  
                    <p:selectOneMenu  value="">  
                        <f:selectItem itemLabel="Selecione" itemValue="" />  
                        <f:selectItem itemLabel="Feminino" itemValue="F" />  
                        <f:selectItem itemLabel="Masculino" itemValue="M" />  
                    </p:selectOneMenu>  

                    <h:outputText value="Data Nascimento"/>

                    <p:calendar locale="pt" showButtonPanel="true" navigator="true" id="dtNascimento"/>     

                    <h:outputText value="Cpf"/>
                    <p:inputText id="txtCpf" value="" ></p:inputText>

                    <h:outputText value="RG"/>
                    <p:inputText id="txtRG" value="" ></p:inputText>
                </p:panelGrid>
                <p:panelGrid  id="pngCad2" columns="4"  style="width: 100%; margin-bottom: 10px"  >
                    <h:outputText value="Cargo"/>
                    <p:inputText id="txtCargo" value="" ></p:inputText>
                    <h:outputText value="Data Cadatro"/>
                    <p:calendar locale="pt" showButtonPanel="true" navigator="true" id="dtCadatro"/>    
                    <h:outputText value="Logradouro"/>
                    <p:inputText id="txtLogradouro" value="" ></p:inputText>

                    <h:outputText value="Número"/>
                    <p:inputText  id="txtNumero" value="" ></p:inputText>

                    <h:outputText value="Complemento"/>
                    <p:inputText  id="txtComplemento" value="" ></p:inputText>

                    <h:outputText value="Bairro"/>
                    <p:inputText  id="txtBairro" value="" ></p:inputText>

                    <h:outputText value="Cidade"/>
                    <p:inputText  id="txtCidade" value="" ></p:inputText>


                    <h:outputText value="Estado"/>
                    <p:inputText  id="txtEstado" value="" ></p:inputText>
                </p:panelGrid>
                <p:panelGrid  id="pngCad3" columns="4"  style="width: 100%; margin-bottom: 10px"  >
                    <h:outputText value="Pais: " />  
                    <p:selectOneMenu  value="">  
                        <f:selectItem itemLabel="Selecione" itemValue="" />  
                        <f:selectItem itemLabel="pais1" itemValue="F" />  
                        <f:selectItem itemLabel="pais2" itemValue="M" />  
                    </p:selectOneMenu>  

                    <h:outputText value="Cep:"/>
                    <p:inputText  id="txtCep" value="" ></p:inputText>

                    <h:outputText value="DDD fixo"/>
                    <p:inputText  id="txtDDDFixo" value="" ></p:inputText>

                    <h:outputText value="Telefone residencial:"/>
                    <p:inputText  id="txtTelefoneResidencial" value="" ></p:inputText>

                    <h:outputText value="DDD celular:"/>
                    <p:inputText  id="txtDDDCelular" value="" ></p:inputText>

                    <h:outputText value="Telefone celular:"/>
                    <p:inputText  id="txtTelefoneCelular" value="" ></p:inputText>
                </p:panelGrid>
                <p:commandButton id="btnSalvar" value="Salvar" actionListener="#{FuncionarioBean.SaveFuncionario()}" /> 
                <p:commandButton id="btnExcluir" value="Excluir" oncomplete="dlg.hide();" /> 
                <p:commandButton id="btnCancelar" value="Cancelar" oncomplete="dlg.hide();" /> 
            </h:form>
        </p:dialog>
        <p:commandButton id="btnNovo" update="pnlEdicao" value="Novo" onclick="dlg.show()"/> 
    </ui:define>
</ui:composition>
